'use strict';
 
module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const BookSchema = new Schema({
        
        bookname: {type: String, required: true,},
        author: {type: String,required: true,},
        img: {type: String,},
        instruction: {type: String,required: true,},
        kind: {type: String,required: true,},
        location: {type: String,},
        num: {type: Number,required: true}
    },
    {
        versionKey:false,//去除版本锁，否则会有_v
        timestamps:{createdAt:'createTime',updatedAt:'updateTime'}//管理时间
    });
    return mongoose.model("Book", BookSchema); 
}